//
//  TCLYGoodsAdressTableViewCell.m
//  YuErmuYing
//
//  Created by LYang on 16/9/3.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYGoodsAdressTableViewCell.h"
#import "Macros.h"
#import "Masonry.h"


@implementation TCLYGoodsAdressTableViewCell
-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = bgColor;
        
        UIView * bgView = [[UIView alloc] init];
        bgView.backgroundColor = [UIColor whiteColor];
        [self addSubview:bgView];
        [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(10);
            make.left.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.bottom.mas_equalTo(self);
        }];
        
        self.telLabel = [[UILabel alloc] init];
        self.telLabel.textColor = blackFont;
        self.telLabel.textAlignment = NSTextAlignmentCenter;
        self.telLabel.font = [UIFont systemFontOfSize:14];
        [bgView addSubview:self.telLabel];
        [self.telLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(12);
            make.right.mas_equalTo(16);
            make.width.mas_equalTo(160);
            make.height.mas_equalTo(20);
        }];
        
        self.nameLabel = [[UILabel alloc] init];
        self.nameLabel.textColor = blackFont;
        self.nameLabel.textAlignment = NSTextAlignmentLeft;
        self.nameLabel.font = [UIFont systemFontOfSize:14];
        [bgView addSubview:self.nameLabel];
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(12);
            make.left.mas_equalTo(12);
            make.right.mas_equalTo(self.telLabel.mas_left).offset(-10);
            make.height.mas_equalTo(20);
        }];
        
        
        self.addressLabel = [[UILabel alloc] init];
        self.addressLabel.font = [UIFont systemFontOfSize:12];
        self.addressLabel.numberOfLines = 0;
        self.addressLabel.textAlignment = NSTextAlignmentLeft;
        self.addressLabel.textColor = blackFont;
        [bgView addSubview:self.addressLabel];
        [self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(18);
            make.left.mas_equalTo(self.nameLabel);
            make.right.mas_equalTo(self.mas_right).offset(-12);
            make.height.mas_equalTo(30);
        }];
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
